package shuzu;

import java.util.Scanner;

public class ShuZu_add {
    public static void main(String[] args) {
        int numslen = 0;
        int target = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("目标值target：");
        target = scanner.nextInt();
        System.out.println("请输入数组长度：");
        numslen = scanner.nextInt();
        int[] nums = new int[numslen];
        System.out.println("请输入数组的每一个元素：");
        for (int i = 0;i < nums.length;i++) {
            nums[i] = scanner.nextInt();
        }
        for (int i = 0;i < nums.length;i++) {
            for (int j = i + 1;j < nums.length;j++) {
                if (nums[i] + nums[j] == target) {
                    System.out.println(i + " " + j +" ");
                }
            }
        }
    }
}
